package com.ayoka.parenting.interf;

public class CallbackUtil {

    public static <T> void  notifySuccess(RequestCallback<T> callBack, T data) {
        if (null != callBack) {
            callBack.onSuccess(data);
        }
    }

    public static void notifyFailure(RequestCallback callBack, int errorCode, String errMsg) {
        if (null != callBack) {
            callBack.onFailure(errorCode, errMsg);
        }
    }

    public static void notifyUpdate(RequestCallback callBack, long currentLength, long totalLength, boolean done) {
        if (null != callBack) {
            callBack.notifyUpdate(currentLength, totalLength, done);
        }
    }
}
